package dao

import (
	"github.com/jinzhu/gorm"
	"log"
)
import _ "github.com/go-sql-driver/mysql"

var (
	DB  *gorm.DB
	err error
)

func MysqlConnect() {
	DB, err = gorm.Open("mysql", "root:123456@tcp(106.55.31.120:3306)/wxLogin?charset=utf8mb4&parseTime=true&loc=Local")
	if err != nil {
		panic("数据库连接失败: " + err.Error())
	}
	log.Println("数据库连接成功")
}
